#ifndef N1DEBUG_H_2009_09_28
#define N1DEBUG_H_2009_09_28

#include "N0Lib.h"
#include "N1Exception.h"

#ifdef DEBUG

#define N1ASSERT(cond) \
  if (!(cond)) \
     N1ThrowException("N1Assert");

#else

#define N1ASSERT(cond)

#endif

#define N1Assert(cond) \
  if (!(cond)) \
     N1ThrowException("N1Assert");

#define N1NonImplemented \
  N1ThrowException("Non implemented");

void N1Check(bool condition);

void N1Exit();

void N1Break();

void N1Crash();


#if defined(__SVR4) || defined(__LINUX__)
int N1GetModuleFileNameByAddr( const void *addr, char *buf, size_t bufSize );
#else
int N1GetModuleFileNameByAddr( const void *addr, wchar_t *buf, int bufSize );
#endif

#ifdef WINDOWS
int N1GetFunctionNameByAddr(N0IntWithPointerSize address, 
                            char* func_name, uint32 size, 
                            N0IntWithPointerSize *offs);
#endif

#endif //N1DEBUG_H_2009_09_28
